import request from '@/utils/request'
export const getDepartment = () => {
  return request({
    url: '/company/department'
  })
}
// 删除部门
export const delDepartment = (id) => {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
// 获取员工简单列表
export const getUserDepts = () => {
  return request({
    url: '/sys/user/simple'
  })
}
// 新增部门
export const addDepartment = data => {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}
// 根据部门id查询部门详情
export const getDepartmentId = id => {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}
// 根据id修改部门
export const updateDepartment = data => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
